class Solution(object):
    def maxAbsoluteSum(self, nums):
        max_a = 0
        now1 = 0
        now2 = 0
        min_b = 0
        for num in nums:
            now1 += num
            now2 += num
            if now1 > 0:
                max_a = max(max_a, now1)
            else:
                now1 = 0
            if now2 < 0:
                min_b = min(now2, min_b)
            else:
                now2 = 0
        return max(max_a, abs(min_b))


